﻿<%@ Page Language="C#" MasterPageFile="/templates/masterpages/default.master" AutoEventWireup="false" CodeBehind="Search.aspx.cs" Inherits="EPiServer.Municipality.Templates.Pages.Search" %>
<%@ Register TagPrefix="EPiServer" TagName="Contact" Src="~/Templates/Units/Contact.ascx" %>
<%@ Import Namespace="EPiServer.Core"%>

<asp:Content runat="server" ContentPlaceHolderID="ComplementaryContent">
    <form method="post" action="<%=CurrentPage.LinkURL%>">
        <div class="form">
            <h2><label for="query"><EPiServer:Translate runat="server" Text="/municipality/templates/search/form/label" EnableViewState="false" /></label></h2>
            <div>
                <input name="query" id="query" type="text" value="<%= SearchQuery %>" />
                <input type="submit" class="button" name="search" value="<%=Translate("/municipality/templates/search/form/searchbutton")%>" />
            </div>
        </div>
    </form>
    <asp:Repeater runat="server" ID="SearchResult" DataSourceID="SearchDataSourceCtrl">
        <HeaderTemplate>
            <ul class="result">
        </HeaderTemplate>
        <ItemTemplate>
            <li>
                <a href="<%#EPiServer.UriSupport.AddLanguageSelection((string)Eval("LinkURL"), (string)Eval("LanguageBranch"))%>"><%#Eval("PageName") %></a>
                <%#GetDescription(Container.DataItem) %>
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
    </asp:Repeater>
   <EPiServer:SearchDataSource PageLink="<%# PageReference.StartPage %>" ID="SearchDataSourceCtrl" runat="server" EnableViewState="false" EnableVisibleInMenu="false" />
    
<asp:Literal ID="SearchMessage" runat="server" />

</asp:Content>

<asp:Content runat="server" ContentPlaceHolderID="ContentBeforeAdditional">
    
    <asp:Repeater ID="ContactsSearchResult" runat="server" DataSourceID="ContactSearchDataSourceCtrl">
        <HeaderTemplate>
        <div>
            <h2><EPiServer:Translate runat="server" Text="/municipality/templates/search/contactsearch" EnableViewState="false" /></h2>
            <ul>
        </HeaderTemplate>
        <ItemTemplate>
             <li><EPiServer:Contact runat="server" CurrentData="<%#Container.DataItem%>"/></li>
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </div>
        </FooterTemplate>
    </asp:Repeater>
    <EPiServer:SearchDataSource PageLink="<%# PageReference.StartPage %>" ID="ContactSearchDataSourceCtrl" runat="server" EnableViewState="false" EnableVisibleInMenu="false" />

</asp:Content>